/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.sd.entity;

import javax.validation.constraints.NotBlank;

import com.jeesite.modules.sys.entity.EmpUser;
import com.jeesite.modules.sys.entity.Office;
import com.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 文件销毁任务Entity
 * @author ysj
 * @version 2020-08-07
 */
@Table(name="sd_doc_destroy_task", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="task_name", attrName="taskName", label="任务名称", queryType=QueryType.LIKE),
		@Column(name="destroy_date", attrName="destroyDate", label="销毁日期"),
		@Column(name="destroy_user_code", attrName="destroyUser.userCode", label="销毁操作人ID"),
		@Column(name="destoy_check_user_code", attrName="destoyCheckUser.userCode", label="监销人ID"),
		@Column(name="destoy_type", attrName="destoyType", label="销毁状态"),

	},
		joinTable = {
				@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="destroyUser", alias="u1",
						on="u1.user_code=a.destroy_user_code", columns={
						@Column(name="user_code", label="用户编码", isPK=true),
						@Column(name="user_name", label="用户名称", isQuery=false),
				}),
				@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="destoyCheckUser", alias="u2",
						on="u2.user_code=a.destoy_check_user_code", columns={
						@Column(name="user_code", label="用户编码", isPK=true),
						@Column(name="user_name", label="用户名称", isQuery=false),
				})
		},

		orderBy="a.id DESC"
)
public class DocDestroyTask extends DataEntity<DocDestroyTask> {
	
	private static final long serialVersionUID = 1L;
	private String taskName;		// 任务名称
	private Date destroyDate;		// 销毁日期
	private User destroyUser;		// 监销人ID
	private User destoyCheckUser;		// 监销人ID
	private String destroyUserCode;
	private String destoyCheckUserCode;
	private String destoyType;
	private String fileCount;

	public String getFileCount() {
		return fileCount;
	}

	public void setFileCount(String fileCount) {
		this.fileCount = fileCount;
	}

	public String getDestoyType() {
		return destoyType;
	}

	public void setDestoyType(String destoyType) {
		this.destoyType = destoyType;
	}

	public User getDestroyUser() {
		return destroyUser;
	}

	public String getDestroyUserCode() {
		return destroyUserCode;
	}

	public void setDestroyUserCode(String destroyUserCode) {
		this.destroyUserCode = destroyUserCode;
	}

	public String getDestoyCheckUserCode() {
		return destoyCheckUserCode;
	}

	public void setDestoyCheckUserCode(String destoyCheckUserCode) {
		this.destoyCheckUserCode = destoyCheckUserCode;
	}

	public void setDestroyUser(User destroyUser) {
		this.destroyUser = destroyUser;
	}

	public User getDestoyCheckUser() {
		return destoyCheckUser;
	}

	public void setDestoyCheckUser(User destoyCheckUser) {
		this.destoyCheckUser = destoyCheckUser;
	}

	public DocDestroyTask() {
		this(null);
	}

	public DocDestroyTask(String id){
		super(id);
	}
	
	@NotBlank(message="任务名称不能为空")
	@Length(min=0, max=100, message="任务名称长度不能超过 100 个字符")
	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="销毁日期不能为空")
	public Date getDestroyDate() {
		return destroyDate;
	}

	public void setDestroyDate(Date destroyDate) {
		this.destroyDate = destroyDate;
	}

	
}